package com.fy.controller;

import com.fy.pojo.Message;
import com.fy.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class MessageController {
    @Autowired
    MessageService messageService;

    @RequestMapping("list")
    public String list(Model model){
        List<Message> list = messageService.list();
        model.addAttribute("list",list);
        return "list";
    }
}
